import Home from "../views/home/Home.vue"
import Center from "../views/center/Center.vue"
import UserAdd from "../views/user-manage/UserAdd"
import UserList from "../views/user-manage/UserList"
import NewsAdd from "../views/news-manage/NewsAdd"
import NewsList from "../views/news-manage/NewsList"
import ProductAdd from "../views/product-manage/ProductAdd"
import ProductList from "../views/product-manage/ProductList"
import NotFound from "@/views/notfound/NotFound.vue"
import NewsEdit from "@/views/news-manage/NewsEdit.vue"
import ProductEdit from "@/views/product-manage/ProductEdit.vue"
const routes = [
    {
        path:"/index",
        name:"index",
        component:Home
    },
    {
        path:"/center", 
        name:"center",
        component:Center
    },
    {
        path:"/user-manage/adduser", 
        name:"adduser",
        component:UserAdd,
        requireAdmin:true
    },
    {
        path:"/user-manage/userlist", 
        name:"userlist",
        component:UserList,
        requireAdmin:true
    },
    
    {
        path:"/news-manage/addnews", 
        name:"addnews",
        component:NewsAdd
    },
    {
        path:"/news-manage/newslist", 
        name:"newslist",
        component:NewsList
    },
    {
        path:"/news-manage/editnews/:id", 
        name:"editnews",
        component:NewsEdit
    },

    {
        path:"/product-manage/addproduct", 
        name:"addproduct",
        component:ProductAdd
    },
    {
        path:"/product-manage/productlist", 
        name:"productlist",
        component:ProductList
    },
    {
        path:"/product-manage/editproduct/:id", 
        name:"editproduct",
        component:ProductEdit
    },

    {
        path:"/",
        redirect:"/index"
    },
    {
        path:"/:pathMatch(.*)*",
        name:"notfound",
        component:NotFound
    }
]

export default routes